<?php
header ( 'Content-Type:text/html; charset=UTF-8' );
@$zcname = $_REQUEST ['zcusername'];
@$zcpassword = $_REQUEST ['zcpassword'];
@$qrpassword = $_REQUEST ['qrpassword'];
@$xm = $_REQUEST ['xm'];
@$tel = $_REQUEST ['tel'];
@$dizhi = $_REQUEST ['dizhi'];
$pdo = new PDO ( 'mysql:dbname=crm;charset=utf8', 'root' );
if (! empty ( $zcname ) && ! empty ( $qrpassword )) {
		$s = $pdo->prepare ( 'insert into username(name,password,sf,xm,tel,dizhi) values(:name,:password,:sf,:xm,:tel,:dizhi)' );
		$isok = $s->execute ( array (
				'name' => $zcname,
				'password' => $qrpassword,
				'sf'=>"keh",
				'xm'=>$xm,
		        'tel'=>$tel,
				'dizhi'=>$dizhi,
		) );
		if ($isok) {
			echo json_encode ( array (
				'zt' => true,
				'fhwb' => '注册成功' 
		) );
		} else {
			echo json_encode ( array (
				'zt' => false,
				'fhwb' => '注册失败' 
		) );
		}
} else {
	echo json_encode ( array (
			'zt' => false,
			'fhwb' => '帐号密码不能为空' 
	) );
}
?>